// src/api/api.js
import axios from 'axios';

const API_BASE_URL = 'http://localhost:9205/api'; // 根据实际情况调整基础URL

export const fetchData = async (startDate, endDate) => {
  try {
    const response = await axios.get(`${API_BASE_URL}/data`, {
      params: {
        startDate,
        endDate,
      },
    });
    return response.data;
  } catch (error) {
    console.error('获取数据失败:', error);
    throw error;
  }
};
